<!DOCTYPE html>
<html>
<head>
  <title>EDM Admin</title>
  <%= stylesheet_link_tag    "application", media: "all", "data-turbolinks-track" => true %>
  <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
  <%= csrf_meta_tags %>
</head>

<body>
<nav class="navbar navbar-default navbar-fixed-top">
  <div class="container">
  <div class="navbar-header">
    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>
    <a class="navbar-brand" href="#">EDM</a>
  </div>
  <div class="navbar-collapse collapse navbar-responsive-collapse">
    <ul class="nav navbar-nav">
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Mails <b class="caret"></b></a>
        <ul class="dropdown-menu">
          <li><%= link_to 'List mails', promotion_mails_path %></li>
          <%= li_if current_admin.can?(:create_mail) do %>
            <%= link_to 'New mail', new_promotion_mail_path %>
          <% end %>
        </ul>
      </li>
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Users <b class="caret"></b></a>
        <ul class="dropdown-menu">
          <li><%= link_to 'Users info', users_path %></li>
          <%= li_if current_admin.can?(:create_user) do %>
              <%= link_to 'New user', new_user_path %>
          <% end %>
          <%= li_if current_admin.can?(:create_user) do %>
              <%= link_to 'New all users', new_all_users_path %>
          <% end %>
        </ul>
      </li>
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">User Groups <b class="caret"></b></a>
        <ul class="dropdown-menu">
          <li><%= link_to 'List user groups', user_groups_path %></li>
          <%= li_if current_admin.can?(:create_user_group) do %>
              <%= link_to 'New user group', new_user_group_path %>
          <% end %>
        </ul>
      </li>
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Admins <b class="caret"></b></a>
        <ul class="dropdown-menu">
          <li><%= link_to 'List admins', admins_path %></li>
          <%= li_if current_admin.can?(:create_admin) do %>
              <%= link_to 'New admin', new_admin_path %>
          <% end %>
          <li><%= link_to 'List roles', roles_path %></li>
          <%= li_if current_admin.can?(:create_admin) do %>
              <%= link_to 'New role', new_role_path %>
          <% end %>
        </ul>
      </li>
    </ul>
    <ul class="nav navbar-nav navbar-right">
      <li><%= link_to 'Sign out', destroy_admin_session_path, method: :delete %></li>
    </ul>
  </div>
  </div>
</nav>

<div class="container">
  <div class="bs-docs-section">
    <div class="row">
      <menu class="col-lg-3">
        <ul class="nav nav-pills nav-stacked" style="max-width: 300px;">
          <li class="dropdown">
            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
              List mails <span class="caret"></span>
            </a>
            <ul class="dropdown-menu">
              <li><%= link_to 'All', promotion_mails_path %></li>
              <% %w(sending complete not_started drafts).each do |status| %>
                  <li>
                    <%= link_to status.humanize, promotion_mails_path(status: status) %>
                  </li>
              <% end %>
            </ul>
          </li>
          <%= li_if current_admin.can?(:create_mail) do %>
              <%= link_to 'New mail', new_promotion_mail_path %>
          <% end %>
        </ul>
      </menu>
      <div class="col-lg-9">
        <%= yield %>
      </div>
    </div>
  </div>
</div>

</body>
</html>
